﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Commlibrary
{
    public class CommonCheck
    {
        public static Boolean isRegexMatch(String sRegex, String sCmpValue)
        {
            Regex regex = new Regex(sRegex);
            return regex.IsMatch(sCmpValue);
        }

        public static Boolean isInteger(String sCmpValue)
        {
            return isRegexMatch(Const.REGEX_INT, sCmpValue);
        }

        public static Boolean isFloat(String sCmpValue)
        {
            return isRegexMatch(Const.REGEX_FLOAT, sCmpValue);
        }
    }
}
